package xyz.molzhao.performance;

import xyz.molzhao.util.CommonUtil;

import java.util.concurrent.CompletableFuture;

/**
 * 这段代码里有两个异步任务 按道理A和B应该在不同的线程中执行
 */
public class ThenRunAsyncThreadReuse {
    public static void main(String[] args) {
        CompletableFuture.runAsync(() -> CommonUtil.createBehavior("A"))
                .thenRunAsync(() -> CommonUtil.createBehavior("B"))
                .join();
    }
}
